<?php
session_start();
if(!isset($_SESSION['uid']))
 	{?>
		<script type="text/javascript">
			window.location="error.php";
		</script>
	<?php
 	}else
 		{
 			include_once 'topStaticBar.php';
 			include_once 'dataBaseConnectivityFile.php';
			$sql_get=mysql_query("select * from vehicle_condition where VEHICLE_CONDITION_ID=".$_REQUEST['condition_id']);
			
			if (!$sql_get)
 			{
    			echo 'Could not run query: '.mysql_error();
			}

			while ($db_field=mysql_fetch_assoc($sql_get))
                {
                    $SERVICE_HISTORY=$db_field["SERVICE_HISTORY"];
                    $CONDITION_REPORT=$db_field["CONDITION_REPORT"];
                    $TIRES_WHEELS=$db_field["TIRES_WHEELS"];                    
                }
 		?>	
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<h1 align="center">Edit Vehicle Condition Information</h1>
	<form name="form" method="post" action="editVehicleCondtionServer.php">
		<input type="hidden" name="vehicle_id" value="<?php echo $_REQUEST['condition_id']?>">
		<table border="1" align="center">
			<tr>
				<td align="right">
					ADDITIONAL Vehicle Condition Information:
				</td>
				<td align="left">
					<textarea style="width: 400px;height: 100px" name="service"><?php echo $SERVICE_HISTORY?></textarea> 
				</td>
				<td align="left">
					<input type="text" style="width: 400px" name="condition" 
					value="<?php echo $CONDITION_REPORT	?>"> 
				</td>
				<td align="left">
					<input type="text" style="width: 400px" name="tiresandwheels" 
					value="<?php echo $TIRES_WHEELS	?>"> 
				</td>								
			</tr> 	
			<tr>
				<td align="right">
					<input type="submit" name="submit" value="Update">
				</td>
			</tr>
</table>
</form>				
<?php
 }
 ?>